﻿using Project.Core.Config.Entity;
using System.ComponentModel.DataAnnotations.Schema;

namespace Project.Core.Test.Entity
{
    /// <summary>
    /// 后台管理员用户角色表
    /// </summary>
    [Table("sys_role")]
    public class SysRole : BaseEntity<int>
    {
        /// <summary>
        /// 角色名
        /// </summary>
        [Column("name")]
        public string Name { get; set; }
        /// <summary>
        /// 角色
        /// </summary>
        [Column("code")]
        public string Code { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        [Column("remark")]
        public string? Remark { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]    //看不到
        [System.Text.Json.Serialization.JsonIgnore]     //不可修改
        [Column("created")]
        public DateTime Created { get; set; }
        /// <summary>
        /// 更新时间
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]    //看不到
        [System.Text.Json.Serialization.JsonIgnore]     //不可修改
        [Column("updated")]
        public DateTime? Updated { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        [Column("state")]
        public bool State { get; set; }

        [NotMapped]
        [System.Text.Json.Serialization.JsonIgnore]     //不可修改
        [Column("sysPerms")]
        public List<SysPerm> SysPerms { get; set; } = new List<SysPerm>();
    }
}
